Figure 4A

Figure 4A highlights the geomeTriD package, illustrating its ability to visualize 3D models derived from Dip-C, along with multiple genomic signals mapped onto single-cell 3D structures.

Load Libraries

library(geomeTriD)
library(geomeTriD.documentation)
library(GenomicRanges)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
library(org.Hs.eg.db)
library(colorRamps)

Present single cell 3D structure for human Dip-C data

This data were downloaded from GEO with accession GSE117874. We will first present the GM12878 cell 3 with all chromosomes.

## set supperloop positions
supperloops <- GRanges(c('Xa:56800000-56850000',
                         'Xa:75350000-75400000',
                         'Xa:115000000-115050000',
                         'Xa:130850000-130900000',
                         'Xb:56800000-56850000',
                         'Xb:75350000-75400000',
                         'Xb:115000000-115050000',
                         'Xb:130850000-130900000'))
names(supperloops) <- c('ICCE', 'x75', 'DXZ4', 'FIRRE',
                        'ICCE', 'x75', 'DXZ4', 'FIRRE')
supperloops$label <- names(supperloops)
supperloops$col <- c(2:5, 2:5) ## set colors for each element
supperloops$type <- 'gene' ## set it as gene

## set the data folder, all data are available in the extdata folder of this package
extdata <- system.file('extdata', 'GSE117874', package='geomeTriD.documentation')
hickit_3dg <- dir(extdata, '3dg', full.names = TRUE)
## load the data
hickit <- import3dg(hickit_3dg, parental_postfix=NULL)[[1]]
## set colors to emphersize the Xa and Xb
col.backbone <- gray.colors(n = length(seqlevels(hickit)))
names(col.backbone) <- seqlevels(hickit)
col.backbone['Xa'] <- 'brown'
col.backbone['Xb'] <- 'orange'

cell3 <- view3dStructure(hickit, feature.gr = supperloops,
                renderer = 'none', resolution=1,
                col.backbone = col.backbone, lwd.backbone = 0.25)
backbone <- extractBackbonePositions(cell3, names(cell3)[grepl('backbone', names(cell3))])
supperloop_spheres <- createTADGeometries(supperloops, backbone, alpha = 0.8)
## Warning in createTADGeometries(supperloops, backbone, alpha = 0.8): input tad
## has duplicated label. Please keep it unique.
threeJsViewer(cell3, supperloop_spheres)